home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / catman / p_man / cat3 / qbuffer.Z / qbuffer
Encoding:
Text File  |  1998-10-28  |  13.8 KB  |  331 lines

  1.  
  2.  
  3.  
  4.      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       QBuffer - I/O    device that operates on    a QByteArray
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       #include <qbuffer.h>
  13.  
  14.       Inherits QIODevice.
  15.  
  16.     PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrrssss
  17.       QQQQBBBBuuuuffffffffeeeerrrr (((())))
  18.       QQQQBBBBuuuuffffffffeeeerrrr (((( QQQQBBBByyyytttteeeeAAAArrrrrrrraaaayyyy ))))
  19.       ~~~~QQQQBBBBuuuuffffffffeeeerrrr ()
  20.       QQQQBBBByyyytttteeeeAAAArrrrrrrraaaayyyy bbbbuuuuffffffffeeeerrrr (((()))) ccccoooonnnnsssstttt
  21.       bbbboooooooollll sssseeeettttBBBBuuuuffffffffeeeerrrr (((( QQQQBBBByyyytttteeeeAAAArrrrrrrraaaayyyy ))))
  22.       vvvviiiirrrrttttuuuuaaaallll bbbboooooooollll ooooppppeeeennnn (((( iiiinnnntttt ))))
  23.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd cccclllloooosssseeee (((())))
  24.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd fffflllluuuusssshhhh (((())))
  25.       vvvviiiirrrrttttuuuuaaaallll uuuuiiiinnnntttt ssssiiiizzzzeeee (((()))) ccccoooonnnnsssstttt
  26.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt aaaatttt (((()))) ccccoooonnnnsssstttt
  27.       vvvviiiirrrrttttuuuuaaaallll bbbboooooooollll aaaatttt (((( iiiinnnntttt    ))))
  28.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt rrrreeeeaaaaddddBBBBlllloooocccckkkk    (((( cccchhhhaaaarrrr **** _p,,,, uuuuiiiinnnntttt ))))
  29.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt wwwwrrrriiiitttteeeeBBBBlllloooocccckkkk (((( ccccoooonnnnsssstttt cccchhhhaaaarrrr ****    _p,,,, uuuuiiiinnnntttt    ))))
  30.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt rrrreeeeaaaaddddLLLLiiiinnnneeee (((( cccchhhhaaaarrrr ****    _p,,,, uuuuiiiinnnntttt    ))))
  31.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt ggggeeeettttcccchhhh (((())))
  32.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt ppppuuuuttttcccchhhh (((( iiiinnnntttt ))))
  33.       vvvviiiirrrrttttuuuuaaaallll iiiinnnntttt uuuunnnnggggeeeettttcccchhhh ((((    iiiinnnntttt ))))
  34.  
  35.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  36.       The QBuffer class is an I/O device that operates on a
  37.       QByteArray
  38.  
  39.       QBuffer is an    I/O device for reading and writing a memory
  40.       buffer. A QBuffer may    be used    directly (readBlock() and
  41.       writeBlock())    or more    conveniently via QDataStream or
  42.       QTextStream. Most of its behavior is inherited from
  43.       QIODevice.
  44.  
  45.       A QBuffer has    an associated QByteArray which holds the
  46.       buffer data. Writing data at the end (i.e. size()) of    the
  47.       buffer expands the byte array.
  48.  
  49.       For convenience, the byte stream classes QDataStream and
  50.       QTextStream can operate on a QByteArray (or a    QString) via
  51.       an internal QBuffer:
  52.  
  53.           QString str;
  54.           QTextStream ts( str, IO_WriteOnly    );
  55.           ts << "pi    = " << 3.14;              // str == "pi    = 3.14"
  56.  
  57.       See also: QFile, QDataStream and QTextStream.
  58.  
  59.       Examples:  grapher/grapher.cpp
  60.  
  61.  
  62.  
  63.      Page 1                         (printed 9/22/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))
  71.  
  72.  
  73.  
  74.      MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDOOOOCCCCUUUUMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  75.      QQQQBBBBuuuuffffffffeeeerrrr::::::::QQQQBBBBuuuuffffffffeeeerrrr (((())))
  76.       Constructs an    empty buffer.
  77.  
  78.      QQQQBBBBuuuuffffffffeeeerrrr::::::::QQQQBBBBuuuuffffffffeeeerrrr ((((    QQQQBBBByyyytttteeeeAAAArrrrrrrraaaayyyy bbbbuuuuffff ))))
  79.       Constructs a buffer and sets the buffer contents to _b_u_f.
  80.  
  81.       See also: setBuffer().
  82.  
  83.      QQQQBBBBuuuuffffffffeeeerrrr::::::::~~~~QQQQBBBBuuuuffffffffeeeerrrr (((())))
  84.       Destroys the buffer.
  85.  
  86.      bbbboooooooollll QQQQBBBBuuuuffffffffeeeerrrr::::::::aaaatttt ((((    iiiinnnntttt ppppoooossss    )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  87.       Sets the buffer index    to _p_o_s.    Returns    TRUE if    successful,
  88.       otherwise FALSE.
  89.  
  90.       See also: size().
  91.  
  92.       Reimplemented    from QIODevice.
  93.  
  94.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::aaaatttt (((())))    ccccoooonnnnsssstttt [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  95.       Returns the buffer index.
  96.  
  97.       See also: size().
  98.  
  99.       Reimplemented    from QIODevice.
  100.  
  101.      QQQQBBBByyyytttteeeeAAAArrrrrrrraaaayyyy    QQQQBBBBuuuuffffffffeeeerrrr::::::::bbbbuuuuffffffffeeeerrrr    (((()))) ccccoooonnnnsssstttt
  102.       Returns the buffer most recently set by setBuffer(), or at
  103.       construction.
  104.  
  105.      vvvvooooiiiidddd QQQQBBBBuuuuffffffffeeeerrrr::::::::cccclllloooosssseeee (((()))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  106.       Closes an open buffer.
  107.  
  108.       See also: open().
  109.  
  110.       Examples:  grapher/grapher.cpp
  111.  
  112.       Reimplemented    from QIODevice.
  113.  
  114.      vvvvooooiiiidddd QQQQBBBBuuuuffffffffeeeerrrr::::::::fffflllluuuusssshhhh (((()))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  115.       The flush function does nothing.
  116.  
  117.       Reimplemented    from QIODevice.
  118.  
  119.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::ggggeeeettttcccchhhh    (((()))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  120.       Reads    a single byte/character    from the buffer.
  121.  
  122.       Returns the byte/character read, or -1 if the    end of the
  123.       buffer has been reached.
  124.  
  125.       See also: putch() and    ungetch().
  126.  
  127.  
  128.  
  129.      Page 2                         (printed 9/22/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))
  137.  
  138.  
  139.  
  140.       Reimplemented    from QIODevice.
  141.  
  142.      bbbboooooooollll QQQQBBBBuuuuffffffffeeeerrrr::::::::ooooppppeeeennnn    (((( iiiinnnntttt mmmm    )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  143.       Opens    the file specified by the file name currently set,
  144.       using    the mode _m. Returns TRUE if successful,    otherwise
  145.       FALSE.
  146.  
  147.       The mode parameter _m must be a combination of    the following
  148.       flags.
  149.  
  150.       IO_ReadOnly opens a buffer in    read-only mode.
  151.  
  152.       IO_WriteOnly opens a buffer in write-only mode.
  153.  
  154.       IO_ReadWrite opens a buffer in read/write mode.
  155.  
  156.       IO_Append sets the buffer index to the end of    the buffer.
  157.  
  158.       IO_Truncate truncates    the buffer.
  159.  
  160.       See also: close() and    isOpen().
  161.  
  162.       Examples:  grapher/grapher.cpp
  163.  
  164.       Reimplemented    from QIODevice.
  165.  
  166.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::ppppuuuuttttcccchhhh    (((( iiiinnnntttt cccchhhh )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  167.       Writes the character _c_h into the buffer, overwriting the
  168.       character at the current index, extending the    buffer if
  169.       necessary.
  170.  
  171.       Returns _c_h, or -1 if some error occurred.
  172.  
  173.       See also: getch() and    ungetch().
  174.  
  175.       Examples:  grapher/grapher.cpp
  176.  
  177.       Reimplemented    from QIODevice.
  178.  
  179.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::rrrreeeeaaaaddddBBBBlllloooocccckkkk (((( cccchhhhaaaarrrr **** pppp,,,,    uuuuiiiinnnntttt lllleeeennnn )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  180.       Reads    at most    _l_e_n bytes from the buffer into _p and returns
  181.       the number of    bytes actually read.
  182.  
  183.       Returns -1 if    a serious error    occurred.
  184.  
  185.       See also: writeBlock().
  186.  
  187.       Reimplemented    from QIODevice.
  188.  
  189.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::rrrreeeeaaaaddddLLLLiiiinnnneeee (((( cccchhhhaaaarrrr **** pppp,,,, uuuuiiiinnnntttt mmmmaaaaxxxxlllleeeennnn )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  190.       Reads    a line of text.
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                         (printed 9/22/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))
  203.  
  204.  
  205.  
  206.       Reads    bytes from the buffer until end-of-line    is reached, or
  207.       up to    _m_a_x_l_e_n bytes.
  208.  
  209.       See also: readBlock().
  210.  
  211.       Reimplemented    from QIODevice.
  212.  
  213.      bbbboooooooollll QQQQBBBBuuuuffffffffeeeerrrr::::::::sssseeeettttBBBBuuuuffffffffeeeerrrr (((( QQQQBBBByyyytttteeeeAAAArrrrrrrraaaayyyy bbbbuuuuffff ))))
  214.       Replaces the buffer's    contents with _b_u_f.
  215.  
  216.       This may not be done while the buffer    is open.
  217.  
  218.       Note that if you open    the buffer in write mode (IO_WriteOnly
  219.       or IO_ReadWrite) and write something into the    buffer,    _b_u_f is
  220.       also modified    because    QByteArray is an explicitly shared
  221.       class.
  222.  
  223.       Example:
  224.  
  225.           QString str = "abc";
  226.           QBuffer b( str );
  227.           b.open( IO_WriteOnly );
  228.           b.at( 3 );                  // position at \0
  229.           b.writeBlock( "def", 4 );              // write including \0
  230.           b.close();
  231.         // Now,    str == "abcdef"
  232.  
  233.       See also: open and Shared Classes
  234.  
  235.      uuuuiiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::ssssiiiizzzzeeee    (((()))) ccccoooonnnnsssstttt [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  236.       Returns the number of    bytes in the buffer.
  237.  
  238.       See also: at().
  239.  
  240.       Reimplemented    from QIODevice.
  241.  
  242.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::uuuunnnnggggeeeettttcccchhhh (((( iiiinnnntttt    cccchhhh )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  243.       Puts the character _c_h    back into the buffer and decrements
  244.       the index if it is not zero.
  245.  
  246.       This function    is normally called to "undo" a getch()
  247.       operation.
  248.  
  249.       Returns _c_h, or -1 if some error occurred.
  250.  
  251.       See also: getch() and    putch().
  252.  
  253.       Reimplemented    from QIODevice.
  254.  
  255.      iiiinnnntttt QQQQBBBBuuuuffffffffeeeerrrr::::::::wwwwrrrriiiitttteeeeBBBBlllloooocccckkkk (((( ccccoooonnnnsssstttt cccchhhhaaaarrrr **** pppp,,,, uuuuiiiinnnntttt lllleeeennnn    )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  256.       Writes _l_e_n bytes from    _p into the buffer at the current
  257.       index, overwriting any characters there and extending    the
  258.  
  259.  
  260.  
  261.      Page 4                         (printed 9/22/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQBBBBuuuuffffffffeeeerrrr((((3333qqqqtttt))))
  269.  
  270.  
  271.  
  272.       buffer if necessary. Returns the number of bytes actually
  273.       written.
  274.  
  275.       Returns -1 if    a serious error    occurred.
  276.  
  277.       See also: readBlock().
  278.  
  279.       Reimplemented    from QIODevice.
  280.  
  281.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  282.       hhhhttttttttpppp::::////////wwwwwwwwwwww....ttttrrrroooollllllll....nnnnoooo////qqqqtttt////qqqqbbbbuuuuffffffffeeeerrrr....hhhhttttmmmmllll
  283.  
  284.      CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  285.       Copyright 1992-1997 Troll Tech AS.  See the LICENSE file
  286.       included in the distribution for a complete license
  287.       statement.
  288.  
  289.      AAAAUUUUTTTTHHHHOOOORRRR
  290.       Generated automatically from the source code.
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                         (printed 9/22/98)
  328.  
  329.  
  330.  
  331.